package net.zjitc.object.printer;

import net.zjitc.object.printer.CanonPrinter;
import net.zjitc.object.printer.HPPrinter;
import net.zjitc.object.printer.Printer;

/**
 * @Author admin
 * @Date 2019/3/15 11:28
 */

public class Test {
    public static void main(String[] args) {
        int a=1;
        Printer printer=PrinterFactory.getPrinter(a);
        printer.open();
        printer.print();
        printer.close();





       /* boolean flag = true;
        Printer printer;
        if (flag) {
            printer = new HPPrinter();
        } else {
            printer = new CanonPrinter();
        }
        printer.open();
        printer.print();
        printer.close();*/

       /*  if (flag){
            HPPrinter hp=new HPPrinter();
            hp.open();
            hp.print();
            hp.close();
        }else{
            CanonPrinter canon=new CanonPrinter();
            canon.open();
            canon.print();
            canon.close();
        }*/

    }
}
